package com.yc.knn;


import com.yc.knn.bean.BankMarketing;
import com.yc.knn.bean.Sample;

import java.util.List;

public class Test_main {
    public static void main(String[] args) {
        //问题： 路径：
        //用System.getProperty("user.dir"); 取得项目的执行路径
        // System.getProperty("user.home"); 取得用户目录 c:\\users\\用户名
        System.out.println(System.getProperty("user.dir"));
            //以上返回D:\ruanjian\STUDY\javastudy\knn
        String path=System.getProperty("user.dir")+"\\src\\main\\java\\com\\yc\\data\\bank.data";
        System.out.println(path);
        List<BankMarketing> list = BankMarketingLoader.load(path);

        for(BankMarketing bm:list){
            System.out.println(bm);
        }
        System.out.println(list.size());

        EuclideanDistanceCalculator edc = new EuclideanDistanceCalculator();
        System.out.println(edc.calculate(new Student(2, 4), new Student(3, 5)));
    }
}

class Student extends Sample {
    private double weight;
    private double height;

    public Student(double weight, double height) {
        this.weight = weight;
        this.height = height;
    }

    @Override
    public String getTag() {
        return null;
    }

    @Override
    public double[] getExample() {
        return new double[]{weight,height};
    }
}
